<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

	<xsl:output 
		method="xml" 
		indent="yes" 
		omit-xml-declaration="yes"
		doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
		doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>

	<xsl:template match="/SpringMole">
		<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
			<head>
				<xsl:element name="script">
					<xsl:attribute name="type">text/javascript</xsl:attribute>
					<xsl:attribute name="src">http://yui.yahooapis.com/2.8.2r1/build/yuiloader/yuiloader-min.js</xsl:attribute>
					<xsl:comment> YUI Loader </xsl:comment>
				</xsl:element>

				<title>SpringMole</title>
			</head>
			<body class="yui-skin-sam">

               
				<xsl:element name="script">
					<xsl:attribute name="type">text/javascript</xsl:attribute>
					<xsl:comment>
					<![CDATA[
						(function() {
							var resource = "]]><xsl:value-of select="Environment/Path/@resource" /><![CDATA[";
							var yuiFilter = "]]><xsl:value-of select="Environment/Path/@yuiFilter" /><![CDATA[";
							var yuiCombine = "]]><xsl:value-of select="Environment/Path/@yuiCombine" /><![CDATA[";
							
							
							var loader = new YAHOO.util.YUILoader({
								require: ['springmole'],
								loadOptional: false,
								combine: yuiCombine,
								filter: yuiFilter,
								allowRollup: true,
								onSuccess: function () {
									YAHOO.springmole.SpringMole.init(loader.sorted);
								},
								onFailure: function () {
									alert('error loading');
								}
							});
						
							loader.addModule({
							    name: 'springmolecss',
							    type: 'css',
							    fullpath: resource + 'css/springmole.css',
							    varName: 'springmolecss'
							});
							loader.addModule({
							    name: 'springmole',
							    type: 'js',
							    fullpath: resource + 'js/springmole.js',
							    varName: 'springmole',
							    requires: [
							    	'springmolecss', 'reset-fonts-grids',
							    	'datejs','cookie','resize','layout','animation','datatable','paginator','container','element','button','connection','dragdrop','menu','tabview','treeview','yahoo-dom-event','yuiloader-dom-event',
							    	'formelement', 'httpmanager', 'springmolepanel', 'statuspanel', 'connectionpanel', 'hibernatepanel'
							    ]
							});
							
							
							
							loader.addModule({
							    name: 'springmolemanager',
							    type: 'js',
							    fullpath: resource + 'js/springmolemanager.js',
							    varName: 'springMoleManager'
							});							
							loader.addModule({
							    name: 'formelement',
							    type: 'js',
							    fullpath: resource + 'js/lib/formelement.js',
							    varName: 'formElement'
							});
							loader.addModule({
							    name: 'httpmanager',
							    type: 'js',
							    fullpath: resource + 'js/lib/httpmanager.js',
							    varName: 'httpManager'
							});							
							
							loader.addModule({
							    name: 'sqldatapanel',
							    type: 'js',
							    fullpath: resource + 'js/sqldatapanel.js',
							    varName: 'sqlDataPanel',
							    requires: ['springmolepanel']
							});							
							loader.addModule({
							    name: 'statuspanel',
							    type: 'js',
							    fullpath: resource + 'js/statuspanel.js',
							    varName: 'statusPanel',
							    requires: ['springmolepanel']
							});							

							loader.addModule({
							    name: 'connectionpanel',
							    type: 'js',
							    fullpath: resource + 'js/connectionpanel.js',
							    varName: 'connectionPanel',
							    requires: ['tablepanel', 'querypanel']
							});							
							loader.addModule({
							    name: 'hibernatepanel',
							    type: 'js',
							    fullpath: resource + 'js/hibernatepanel.js',
							    varName: 'hibernatePanel'
							});
							loader.addModule({
							    name: 'tablepanel',
							    type: 'js',
							    fullpath: resource + 'js/tablepanel.js',
							    varName: 'tablePanel',
							    requires: ['sqldatapanel']
							});																					
							loader.addModule({
							    name: 'querypanel',
							    type: 'js',
							    fullpath: resource + 'js/querypanel.js',
							    varName: 'queryPanel',
							    requires: ['sqldatapanel']
							});
							loader.addModule({
							    name: 'springmolepanel',
							    type: 'js',
							    fullpath: resource + 'js/springmolepanel.js',
							    varName: 'springMolePanel',
							    requires: ['springmolemanager', 'formelement', 'httpmanager']
							});
																
							loader.addModule({
							    name: 'datejs',
							    type: 'js',
							    fullpath: resource + 'lib/datejs/date.js',
							    varName: 'dateJS'
							});
																											
							loader.insert();
						})();
					]]>						
					</xsl:comment>
				</xsl:element>               
                
			</body>
		</html>
	</xsl:template>


</xsl:stylesheet>